<!DOCTYPE html>
<html>
	<head>
		<include file="Public/head" />
		<link rel="stylesheet" href="__PUBLIC__/Manage/css/table.css">
		<title>推荐订单</title>
	</head>
	<body>
		<div class="nestable">
			<div class="console-title console-title-border drds-detail-title clearfix">
				<h5>借款审核</h5>
			</div>
			<form method="get" id="seachForm">
				<input type="hidden" name="m" value="Loan" />
				<input type="hidden" name="a" value="pending" />
				<div class="public-selectArea">
					<div class="clearfix">
						<div class="wp_box col-xs-6">
							<dl>
								<dt>订单号：</dt>
								<dd>
									<input type="text" name="s-oid" value="{$Think.get.s-oid}">
								</dd>
							</dl>
						</div>
						<div class="wp_box col-xs-6">
							<dl>
								<dt>申请时间：</dt>
								<dd>
									<input type="date" class="time-inp" name="s-timeStart" value="{$Think.get.s-timeStart}" />
								</dd>
								<dd>
									<input type="date" class="time-inp" name="s-timeEnd" value="{$Think.get.s-timeEnd}" />
								</dd>
							</dl>
						</div>
					</div>
					<div class="btnArea">
						<a href='javascript:$("#seachForm").submit();' class="btn btn-sereachBg">
							<i class="glyphicon glyphicon-search public-ico"></i>
							<span class="public-label">查询</span>
						</a>
					</div>
				</div>
			</form>
			<div class="scroll-bar-table">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>订单号</th>
							<th>用户名</th>
							<th>借款金额</th>
							<th>借款期限</th>
							<th>预期收益</th>
							<th>申请时间</th>
							<th>收款银行</th>
							<th>银行卡号</th>
							<th>开户名称</th>
							<th>合同</th>
							<th>推介人信息</th>
							<!--<th>操作</th>-->
						</tr>
					</thead>
					<tbody>
<volist name="list" id="vo">
						<tr id="list-{$vo.id}">
							<td>{$vo.oid}</td>
							<td>{$vo.user.telnum}</td>
							<td>{$vo.money}元</td>
							<td>
								{$vo.time}<if condition="$vo['timetype'] eq 1">个月<else/>天</if>
							</td>
							<td>{$vo.interest_money}元</td>
							<td>{$vo.add_time|date="Y/m/d H:i:s",###}</td>
							<td>{$vo.bankname}</td>
							<td>{$vo.banknum}</td>
							<td>{$vo.name}</td>
							<td>
								<a href="{:U('Loan/viewContract',array('id'=>$vo['id']))}" title="点击查看合同" target="_blank">查看合同</a>
							</td>
							<td>{$vo.pid|utomn=###}</td>
							<!--<td class="text-left">
								<a href="javascript:setPendingStatus('{$vo.id}',1);">确认打款并生成账单</a>
								<a href="javascript:setPendingStatus('{$vo.id}',2);">驳回申请</a>
							</td>-->
						</tr>
</volist>
					</tbody>
				</table>
			</div>
			<div class="table-pagin-container">
				<div class="pull-right page-box">
					{$page}
				</div>
			</div>
		</div>
	</body>
	<script>
		function setPendingStatus(id,status){
			var title;
			if(status == 1){
				title = '请先检验合同内容及签名并确认打款已成功再确认';
			}else if(status == 2){
				title = '驳回申请需剪短描述驳回原因';
			}else{
				return ;
			}
			layer.confirm(
				title,
				{
					btn: ['下一步','取消']
				},function(){
					layer.closeAll();
					var errorStr;
					if(status == 2){
						layer.prompt(
							{
								title:"请输入驳回原因",
								formType:0
							},
							function(str,index){
								errorStr = str;
								layer.close(index);
								cvphp.post(
									"{:U('Loan/setPendingStatus')}",
									{
										status:status,
										error:errorStr,
										id:id
									},
									function(data){
										if(data.status!=1){
											layer.msg(data.info);
										}else{
											$("#list-"+id).remove();
											layer.msg("操作成功");
										}
									}
								);
							}
						);
					}else{
						cvphp.post(
							"{:U('Loan/setPendingStatus')}",
							{
								status:status,
								id:id
							},
							function(data){
								if(data.status!=1){
									layer.msg(data.info);
								}else{
									$("#list-"+id).remove();
									layer.msg("操作成功");
								}
							}
						);
					}
				}
			);
		}
	</script>
</html>